package com.cheetah.cloud2020.web;

import com.cheetah.cloud2020.dao.EsLogDao;
import com.cheetah.cloud2020.entity.EsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Timestamp;

@RestController
@RequestMapping("/log")
public class EsLogController {
    @Autowired
    private EsLogDao esLogDao;

    @RequestMapping("/indexEs")
    public Object indexEs(@RequestBody EsLog log) {
        log.setTimestamp(new Timestamp(System.currentTimeMillis()));
        return this.esLogDao.index(log);
    }
}
